package middleware

import (
	"wire/internal/data"

	"gitee.com/go-mod/framework/util"

	"github.com/gin-gonic/gin"
	"github.com/spf13/cast"
)

// 初始化中间件
func Init(data *data.Data) gin.HandlerFunc {
	return func(c *gin.Context) {
		requestId := util.Md5(cast.ToString(util.UniqueID()))
		c.Set("requestId", requestId)
	}
}
